package com.blog.common.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 评论
 * </p>
 *
 * @author Valerie
 * @since 2023-03-11
 */
@Data
@TableName("tb_comment")
@ApiModel(value = "Comment对象", description = "评论")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("评论用户Id")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty("评论主题id")
    @TableField("topic_id")
    private Long topicId;

    @ApiModelProperty("评论内容")
    @TableField("comment_content")
    private String commentContent;

    @ApiModelProperty("回复用户id")
    @TableField("reply_user_id")
    private Long replyUserId;

    @ApiModelProperty("回复id")
    @TableField("reply_id")
    private Long replyId;

    @ApiModelProperty("父评论id")
    @TableField("parent_id")
    private Long parentId;

    @ApiModelProperty("评论类型 1.文章 2.友链 3.说说")
    @TableField("type")
    private Integer type;

    @ApiModelProperty("是否删除  0否 1是")
    @TableField("is_delete")
    @TableLogic
    private Integer isDelete;

    @ApiModelProperty("是否审核")
    @TableField("is_review")
    private Integer isReview;

    @ApiModelProperty("评论文章")
    @TableField("comment_article")
    private String commentArticle;

    @ApiModelProperty("评论ip")
    @TableField("ip_address")
    private String ipAddress;

    @ApiModelProperty("评论地址")
    @TableField("ip_source")
    private String ipSource;

    @ApiModelProperty("评论时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;
}
